//
//  UIBarButtonItem+Extensions.m
//  happyHealthyWalk
//
//  Created by newhuidong on 16/2/19.
//  Copyright © 2016年 HuiDong. All rights reserved.
//

#import "UIBarButtonItem+Extensions.h"

@implementation UIBarButtonItem (Extensions)
+(UIBarButtonItem*)barButtonItemWithImage:(NSString *)image hightLightImage:(NSString *)hightImage target:(id)target action:(SEL)action{
    
    UIButton * button=[[UIButton alloc]init];
    
    [button setImage:[UIImage imageNamed:image] forState:0];
    
    
    [button setImage:[UIImage imageNamed:hightImage] forState:UIControlStateHighlighted];
    CGRect frame =button.frame;
    frame.size=button.currentImage.size;
    button.frame=frame;
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc]initWithCustomView:button];
    
    
    
}
@end
